<!-- Reactive全家桶 -->
<template>
    <div v-for="item in form" :key="item.name">
        {{ item.name }}
    </div>
    <button @click="change">改变</button>
</template>

<script setup lang="ts">
    import { ref, reactive, onMounted } from "vue";

    type M = {
        name?: string | number,
        age: number
    }

    // reactive只支持引用类型 Array Object Map Set
    let form = reactive<M[]>([
        {
            name: '123',
            age: 156
        }
    ])

    const change = ()=>{
        form[0].name = Number(form[0].name) + 1;
    }

    onMounted(()=>{  })
</script>
<style scoped lang="less">
</style>